package com.jzo2o.customer.controller.worker;

import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditAddReqDTO;
import com.jzo2o.customer.model.dto.response.RejectReasonResDTO;
import com.jzo2o.customer.service.ICertificationAuditService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author JIAN
 */
@RestController("workerCertificationAuditController")
@RequestMapping("/worker/worker-certification-audit")
@Api(tags = "服务端 - 认证相关接口")
public class CertificationAuditController {
    @Resource
    private ICertificationAuditService certificationAuditService;

    /**
     * 提交认证信息
     */
    @PostMapping
    public void addCertificationInfo(@RequestBody WorkerCertificationAuditAddReqDTO workerCertificationAuditAddReqDTO) {
        certificationAuditService.addCertificationInfoForWorker(workerCertificationAuditAddReqDTO);
    }

    /**
     * 查询当前用户最新的拒绝原因
     */
    @GetMapping("/rejectReason")
    public RejectReasonResDTO getLatestRejectReason() {
        return certificationAuditService.getLatestRejectReason();
    }
}